package com.jusda.service.update;

import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author yiyi
 * @Date 2022/3/11-下午4:20
 * @Description:
 */
public class ThreadPoolUtil {

    private static ThreadPoolExecutor threadPoolExecutor;

    // provide static object generate factory.
    public static ThreadPoolExecutor getThreadPool() {
        threadPoolExecutor = new ThreadPoolExecutor(5, 8, 200, TimeUnit.SECONDS, new SynchronousQueue<Runnable>());
        return threadPoolExecutor;
    }

}
